
* dummies for present on first of each quarter
foreach y in  2007 2008 2009 2010  {
foreach x in apr oct  {
gen `x'`y'=0
replace `x'`y'=1 if rec_in<=td(01`x'`y') & rec_out>td(01`x'`y')
}
}

* interaction terms between present on the first of each quarter and facility FE
* the relevant date FE's go back 8 months before entry
* analysis sample includes those released after April 2008 and before October 2010
tab labelfac91 if RELEASE_YR!=607, gen(lab_) 
foreach x in  oct2007 apr2008 oct2008 apr2009 oct2009 apr2010 oct2010{
foreach y in lab_1 lab_2 lab_3 lab_4 lab_5 lab_6 lab_7 lab_8 lab_9 lab_10 lab_11 lab_12 lab_13 lab_14 lab_15 lab_16 lab_17 lab_18 lab_19 lab_20 lab_21 lab_22 lab_23 lab_24 lab_25 lab_26 lab_27 lab_28 lab_29 lab_30 lab_31 lab_32 lab_33 lab_34 lab_35 lab_36 lab_37 lab_38 lab_39 lab_40 lab_41 lab_42 lab_43 lab_44 lab_45 lab_46 lab_47 lab_48 lab_49 lab_50 lab_51 lab_52 lab_53 lab_54 lab_55 lab_56 lab_57 lab_58 lab_59 lab_60 lab_61 lab_62 lab_63 lab_64 lab_65 lab_66 lab_67 lab_68 lab_69 lab_70 lab_71 lab_72 lab_73 lab_74 lab_75 lab_76 lab_77 lab_78 lab_79 lab_80 lab_81 lab_82 lab_83 lab_84 lab_85 lab_86 lab_87 lab_88 lab_89 lab_90 lab_91 lab_92 lab_93 lab_94 lab_95 lab_96 lab_97 lab_98 lab_99 lab_100 lab_101 lab_102 lab_103 lab_104 lab_105 lab_106 lab_107 lab_108 lab_109 lab_110 lab_111 lab_112 lab_113 lab_114 lab_115 lab_116 lab_117 lab_118 lab_119 lab_120 lab_121 lab_122 lab_123 lab_124 lab_125 lab_126 lab_127 lab_128 lab_129 lab_130 lab_131 lab_132 lab_133 lab_134 lab_135 lab_136 lab_137 lab_138 lab_139 lab_140 lab_141 lab_142 lab_143 lab_144 lab_145 lab_146 lab_147 lab_148 lab_149 lab_150 lab_151 lab_152 lab_153 lab_154 lab_155 lab_156 lab_157 lab_158 lab_159 lab_160 lab_161 lab_162 lab_163 lab_164 {
gen `x'`y'=`x'*`y'
}
}

global ujt oct2007lab_1 oct2007lab_2 oct2007lab_3 oct2007lab_4 oct2007lab_5 oct2007lab_6 oct2007lab_7 oct2007lab_8 oct2007lab_9 oct2007lab_10 oct2007lab_11 oct2007lab_12 oct2007lab_13 oct2007lab_14 oct2007lab_15 oct2007lab_16 oct2007lab_17 oct2007lab_18 oct2007lab_19 oct2007lab_20 oct2007lab_21 oct2007lab_22 oct2007lab_23 oct2007lab_24 oct2007lab_25 oct2007lab_26 oct2007lab_27 oct2007lab_28 oct2007lab_29 oct2007lab_30 oct2007lab_31 oct2007lab_32 oct2007lab_33 oct2007lab_34 oct2007lab_35 oct2007lab_36 oct2007lab_37 oct2007lab_38 oct2007lab_39 oct2007lab_40 oct2007lab_41 oct2007lab_42 oct2007lab_43 oct2007lab_44 oct2007lab_45 oct2007lab_46 oct2007lab_47 oct2007lab_48 oct2007lab_49 oct2007lab_50 oct2007lab_51 oct2007lab_52 oct2007lab_53 oct2007lab_54 oct2007lab_55 oct2007lab_56 oct2007lab_57 oct2007lab_58 oct2007lab_59 oct2007lab_60 oct2007lab_61 oct2007lab_62 oct2007lab_63 oct2007lab_64 oct2007lab_65 oct2007lab_66 oct2007lab_67 oct2007lab_68 oct2007lab_69 oct2007lab_70 oct2007lab_71 oct2007lab_72 oct2007lab_73 oct2007lab_74 oct2007lab_75 oct2007lab_76 oct2007lab_77 oct2007lab_78 oct2007lab_79 oct2007lab_80 oct2007lab_81 oct2007lab_82 oct2007lab_83 oct2007lab_84 oct2007lab_85 oct2007lab_86 oct2007lab_87 oct2007lab_88 oct2007lab_89 oct2007lab_90 oct2007lab_91 oct2007lab_92 oct2007lab_93 oct2007lab_94 oct2007lab_95 oct2007lab_96 oct2007lab_97 oct2007lab_98 oct2007lab_99 oct2007lab_100 oct2007lab_101 oct2007lab_102 oct2007lab_103 oct2007lab_104 oct2007lab_105 oct2007lab_106 oct2007lab_107 oct2007lab_108 oct2007lab_109 oct2007lab_110 oct2007lab_111 oct2007lab_112 oct2007lab_113 oct2007lab_114 oct2007lab_115 oct2007lab_116 oct2007lab_117 oct2007lab_118 oct2007lab_119 oct2007lab_120 oct2007lab_121 oct2007lab_122 oct2007lab_123 oct2007lab_124 oct2007lab_125 oct2007lab_126 oct2007lab_127 oct2007lab_128 oct2007lab_129 oct2007lab_130 oct2007lab_131 oct2007lab_132 oct2007lab_133 oct2007lab_134 oct2007lab_135 oct2007lab_136 oct2007lab_137 oct2007lab_138 oct2007lab_139 oct2007lab_140 oct2007lab_141 oct2007lab_142 oct2007lab_143 oct2007lab_144 oct2007lab_145 oct2007lab_146 oct2007lab_147 oct2007lab_148 oct2007lab_149 oct2007lab_150 oct2007lab_151 oct2007lab_152 oct2007lab_153 oct2007lab_154 oct2007lab_155 oct2007lab_156 oct2007lab_157 oct2007lab_158 oct2007lab_159 oct2007lab_160 oct2007lab_161 oct2007lab_162 oct2007lab_163 oct2007lab_164 apr2008lab_1 apr2008lab_2 apr2008lab_3 apr2008lab_4 apr2008lab_5 apr2008lab_6 apr2008lab_7 apr2008lab_8 apr2008lab_9 apr2008lab_10 apr2008lab_11 apr2008lab_12 apr2008lab_13 apr2008lab_14 apr2008lab_15 apr2008lab_16 apr2008lab_17 apr2008lab_18 apr2008lab_19 apr2008lab_20 apr2008lab_21 apr2008lab_22 apr2008lab_23 apr2008lab_24 apr2008lab_25 apr2008lab_26 apr2008lab_27 apr2008lab_28 apr2008lab_29 apr2008lab_30 apr2008lab_31 apr2008lab_32 apr2008lab_33 apr2008lab_34 apr2008lab_35 apr2008lab_36 apr2008lab_37 apr2008lab_38 apr2008lab_39 apr2008lab_40 apr2008lab_41 apr2008lab_42 apr2008lab_43 apr2008lab_44 apr2008lab_45 apr2008lab_46 apr2008lab_47 apr2008lab_48 apr2008lab_49 apr2008lab_50 apr2008lab_51 apr2008lab_52 apr2008lab_53 apr2008lab_54 apr2008lab_55 apr2008lab_56 apr2008lab_57 apr2008lab_58 apr2008lab_59 apr2008lab_60 apr2008lab_61 apr2008lab_62 apr2008lab_63 apr2008lab_64 apr2008lab_65 apr2008lab_66 apr2008lab_67 apr2008lab_68 apr2008lab_69 apr2008lab_70 apr2008lab_71 apr2008lab_72 apr2008lab_73 apr2008lab_74 apr2008lab_75 apr2008lab_76 apr2008lab_77 apr2008lab_78 apr2008lab_79 apr2008lab_80 apr2008lab_81 apr2008lab_82 apr2008lab_83 apr2008lab_84 apr2008lab_85 apr2008lab_86 apr2008lab_87 apr2008lab_88 apr2008lab_89 apr2008lab_90 apr2008lab_91 apr2008lab_92 apr2008lab_93 apr2008lab_94 apr2008lab_95 apr2008lab_96 apr2008lab_97 apr2008lab_98 apr2008lab_99 apr2008lab_100 apr2008lab_101 apr2008lab_102 apr2008lab_103 apr2008lab_104 apr2008lab_105 apr2008lab_106 apr2008lab_107 apr2008lab_108 apr2008lab_109 apr2008lab_110 apr2008lab_111 apr2008lab_112 apr2008lab_113 apr2008lab_114 apr2008lab_115 apr2008lab_116 apr2008lab_117 apr2008lab_118 apr2008lab_119 apr2008lab_120 apr2008lab_121 apr2008lab_122 apr2008lab_123 apr2008lab_124 apr2008lab_125 apr2008lab_126 apr2008lab_127 apr2008lab_128 apr2008lab_129 apr2008lab_130 apr2008lab_131 apr2008lab_132 apr2008lab_133 apr2008lab_134 apr2008lab_135 apr2008lab_136 apr2008lab_137 apr2008lab_138 apr2008lab_139 apr2008lab_140 apr2008lab_141 apr2008lab_142 apr2008lab_143 apr2008lab_144 apr2008lab_145 apr2008lab_146 apr2008lab_147 apr2008lab_148 apr2008lab_149 apr2008lab_150 apr2008lab_151 apr2008lab_152 apr2008lab_153 apr2008lab_154 apr2008lab_155 apr2008lab_156 apr2008lab_157 apr2008lab_158 apr2008lab_159 apr2008lab_160 apr2008lab_161 apr2008lab_162 apr2008lab_163 apr2008lab_164 oct2008lab_1 oct2008lab_2 oct2008lab_3 oct2008lab_4 oct2008lab_5 oct2008lab_6 oct2008lab_7 oct2008lab_8 oct2008lab_9 oct2008lab_10 oct2008lab_11 oct2008lab_12 oct2008lab_13 oct2008lab_14 oct2008lab_15 oct2008lab_16 oct2008lab_17 oct2008lab_18 oct2008lab_19 oct2008lab_20 oct2008lab_21 oct2008lab_22 oct2008lab_23 oct2008lab_24 oct2008lab_25 oct2008lab_26 oct2008lab_27 oct2008lab_28 oct2008lab_29 oct2008lab_30 oct2008lab_31 oct2008lab_32 oct2008lab_33 oct2008lab_34 oct2008lab_35 oct2008lab_36 oct2008lab_37 oct2008lab_38 oct2008lab_39 oct2008lab_40 oct2008lab_41 oct2008lab_42 oct2008lab_43 oct2008lab_44 oct2008lab_45 oct2008lab_46 oct2008lab_47 oct2008lab_48 oct2008lab_49 oct2008lab_50 oct2008lab_51 oct2008lab_52 oct2008lab_53 oct2008lab_54 oct2008lab_55 oct2008lab_56 oct2008lab_57 oct2008lab_58 oct2008lab_59 oct2008lab_60 oct2008lab_61 oct2008lab_62 oct2008lab_63 oct2008lab_64 oct2008lab_65 oct2008lab_66 oct2008lab_67 oct2008lab_68 oct2008lab_69 oct2008lab_70 oct2008lab_71 oct2008lab_72 oct2008lab_73 oct2008lab_74 oct2008lab_75 oct2008lab_76 oct2008lab_77 oct2008lab_78 oct2008lab_79 oct2008lab_80 oct2008lab_81 oct2008lab_82 oct2008lab_83 oct2008lab_84 oct2008lab_85 oct2008lab_86 oct2008lab_87 oct2008lab_88 oct2008lab_89 oct2008lab_90 oct2008lab_91 oct2008lab_92 oct2008lab_93 oct2008lab_94 oct2008lab_95 oct2008lab_96 oct2008lab_97 oct2008lab_98 oct2008lab_99 oct2008lab_100 oct2008lab_101 oct2008lab_102 oct2008lab_103 oct2008lab_104 oct2008lab_105 oct2008lab_106 oct2008lab_107 oct2008lab_108 oct2008lab_109 oct2008lab_110 oct2008lab_111 oct2008lab_112 oct2008lab_113 oct2008lab_114 oct2008lab_115 oct2008lab_116 oct2008lab_117 oct2008lab_118 oct2008lab_119 oct2008lab_120 oct2008lab_121 oct2008lab_122 oct2008lab_123 oct2008lab_124 oct2008lab_125 oct2008lab_126 oct2008lab_127 oct2008lab_128 oct2008lab_129 oct2008lab_130 oct2008lab_131 oct2008lab_132 oct2008lab_133 oct2008lab_134 oct2008lab_135 oct2008lab_136 oct2008lab_137 oct2008lab_138 oct2008lab_139 oct2008lab_140 oct2008lab_141 oct2008lab_142 oct2008lab_143 oct2008lab_144 oct2008lab_145 oct2008lab_146 oct2008lab_147 oct2008lab_148 oct2008lab_149 oct2008lab_150 oct2008lab_151 oct2008lab_152 oct2008lab_153 oct2008lab_154 oct2008lab_155 oct2008lab_156 oct2008lab_157 oct2008lab_158 oct2008lab_159 oct2008lab_160 oct2008lab_161 oct2008lab_162 oct2008lab_163 oct2008lab_164 apr2009lab_1 apr2009lab_2 apr2009lab_3 apr2009lab_4 apr2009lab_5 apr2009lab_6 apr2009lab_7 apr2009lab_8 apr2009lab_9 apr2009lab_10 apr2009lab_11 apr2009lab_12 apr2009lab_13 apr2009lab_14 apr2009lab_15 apr2009lab_16 apr2009lab_17 apr2009lab_18 apr2009lab_19 apr2009lab_20 apr2009lab_21 apr2009lab_22 apr2009lab_23 apr2009lab_24 apr2009lab_25 apr2009lab_26 apr2009lab_27 apr2009lab_28 apr2009lab_29 apr2009lab_30 apr2009lab_31 apr2009lab_32 apr2009lab_33 apr2009lab_34 apr2009lab_35 apr2009lab_36 apr2009lab_37 apr2009lab_38 apr2009lab_39 apr2009lab_40 apr2009lab_41 apr2009lab_42 apr2009lab_43 apr2009lab_44 apr2009lab_45 apr2009lab_46 apr2009lab_47 apr2009lab_48 apr2009lab_49 apr2009lab_50 apr2009lab_51 apr2009lab_52 apr2009lab_53 apr2009lab_54 apr2009lab_55 apr2009lab_56 apr2009lab_57 apr2009lab_58 apr2009lab_59 apr2009lab_60 apr2009lab_61 apr2009lab_62 apr2009lab_63 apr2009lab_64 apr2009lab_65 apr2009lab_66 apr2009lab_67 apr2009lab_68 apr2009lab_69 apr2009lab_70 apr2009lab_71 apr2009lab_72 apr2009lab_73 apr2009lab_74 apr2009lab_75 apr2009lab_76 apr2009lab_77 apr2009lab_78 apr2009lab_79 apr2009lab_80 apr2009lab_81 apr2009lab_82 apr2009lab_83 apr2009lab_84 apr2009lab_85 apr2009lab_86 apr2009lab_87 apr2009lab_88 apr2009lab_89 apr2009lab_90 apr2009lab_91 apr2009lab_92 apr2009lab_93 apr2009lab_94 apr2009lab_95 apr2009lab_96 apr2009lab_97 apr2009lab_98 apr2009lab_99 apr2009lab_100 apr2009lab_101 apr2009lab_102 apr2009lab_103 apr2009lab_104 apr2009lab_105 apr2009lab_106 apr2009lab_107 apr2009lab_108 apr2009lab_109 apr2009lab_110 apr2009lab_111 apr2009lab_112 apr2009lab_113 apr2009lab_114 apr2009lab_115 apr2009lab_116 apr2009lab_117 apr2009lab_118 apr2009lab_119 apr2009lab_120 apr2009lab_121 apr2009lab_122 apr2009lab_123 apr2009lab_124 apr2009lab_125 apr2009lab_126 apr2009lab_127 apr2009lab_128 apr2009lab_129 apr2009lab_130 apr2009lab_131 apr2009lab_132 apr2009lab_133 apr2009lab_134 apr2009lab_135 apr2009lab_136 apr2009lab_137 apr2009lab_138 apr2009lab_139 apr2009lab_140 apr2009lab_141 apr2009lab_142 apr2009lab_143 apr2009lab_144 apr2009lab_145 apr2009lab_146 apr2009lab_147 apr2009lab_148 apr2009lab_149 apr2009lab_150 apr2009lab_151 apr2009lab_152 apr2009lab_153 apr2009lab_154 apr2009lab_155 apr2009lab_156 apr2009lab_157 apr2009lab_158 apr2009lab_159 apr2009lab_160 apr2009lab_161 apr2009lab_162 apr2009lab_163 apr2009lab_164 oct2009lab_1 oct2009lab_2 oct2009lab_3 oct2009lab_4 oct2009lab_5 oct2009lab_6 oct2009lab_7 oct2009lab_8 oct2009lab_9 oct2009lab_10 oct2009lab_11 oct2009lab_12 oct2009lab_13 oct2009lab_14 oct2009lab_15 oct2009lab_16 oct2009lab_17 oct2009lab_18 oct2009lab_19 oct2009lab_20 oct2009lab_21 oct2009lab_22 oct2009lab_23 oct2009lab_24 oct2009lab_25 oct2009lab_26 oct2009lab_27 oct2009lab_28 oct2009lab_29 oct2009lab_30 oct2009lab_31 oct2009lab_32 oct2009lab_33 oct2009lab_34 oct2009lab_35 oct2009lab_36 oct2009lab_37 oct2009lab_38 oct2009lab_39 oct2009lab_40 oct2009lab_41 oct2009lab_42 oct2009lab_43 oct2009lab_44 oct2009lab_45 oct2009lab_46 oct2009lab_47 oct2009lab_48 oct2009lab_49 oct2009lab_50 oct2009lab_51 oct2009lab_52 oct2009lab_53 oct2009lab_54 oct2009lab_55 oct2009lab_56 oct2009lab_57 oct2009lab_58 oct2009lab_59 oct2009lab_60 oct2009lab_61 oct2009lab_62 oct2009lab_63 oct2009lab_64 oct2009lab_65 oct2009lab_66 oct2009lab_67 oct2009lab_68 oct2009lab_69 oct2009lab_70 oct2009lab_71 oct2009lab_72 oct2009lab_73 oct2009lab_74 oct2009lab_75 oct2009lab_76 oct2009lab_77 oct2009lab_78 oct2009lab_79 oct2009lab_80 oct2009lab_81 oct2009lab_82 oct2009lab_83 oct2009lab_84 oct2009lab_85 oct2009lab_86 oct2009lab_87 oct2009lab_88 oct2009lab_89 oct2009lab_90 oct2009lab_91 oct2009lab_92 oct2009lab_93 oct2009lab_94 oct2009lab_95 oct2009lab_96 oct2009lab_97 oct2009lab_98 oct2009lab_99 oct2009lab_100 oct2009lab_101 oct2009lab_102 oct2009lab_103 oct2009lab_104 oct2009lab_105 oct2009lab_106 oct2009lab_107 oct2009lab_108 oct2009lab_109 oct2009lab_110 oct2009lab_111 oct2009lab_112 oct2009lab_113 oct2009lab_114 oct2009lab_115 oct2009lab_116 oct2009lab_117 oct2009lab_118 oct2009lab_119 oct2009lab_120 oct2009lab_121 oct2009lab_122 oct2009lab_123 oct2009lab_124 oct2009lab_125 oct2009lab_126 oct2009lab_127 oct2009lab_128 oct2009lab_129 oct2009lab_130 oct2009lab_131 oct2009lab_132 oct2009lab_133 oct2009lab_134 oct2009lab_135 oct2009lab_136 oct2009lab_137 oct2009lab_138 oct2009lab_139 oct2009lab_140 oct2009lab_141 oct2009lab_142 oct2009lab_143 oct2009lab_144 oct2009lab_145 oct2009lab_146 oct2009lab_147 oct2009lab_148 oct2009lab_149 oct2009lab_150 oct2009lab_151 oct2009lab_152 oct2009lab_153 oct2009lab_154 oct2009lab_155 oct2009lab_156 oct2009lab_157 oct2009lab_158 oct2009lab_159 oct2009lab_160 oct2009lab_161 oct2009lab_162 oct2009lab_163 oct2009lab_164 apr2010lab_1 apr2010lab_2 apr2010lab_3 apr2010lab_4 apr2010lab_5 apr2010lab_6 apr2010lab_7 apr2010lab_8 apr2010lab_9 apr2010lab_10 apr2010lab_11 apr2010lab_12 apr2010lab_13 apr2010lab_14 apr2010lab_15 apr2010lab_16 apr2010lab_17 apr2010lab_18 apr2010lab_19 apr2010lab_20 apr2010lab_21 apr2010lab_22 apr2010lab_23 apr2010lab_24 apr2010lab_25 apr2010lab_26 apr2010lab_27 apr2010lab_28 apr2010lab_29 apr2010lab_30 apr2010lab_31 apr2010lab_32 apr2010lab_33 apr2010lab_34 apr2010lab_35 apr2010lab_36 apr2010lab_37 apr2010lab_38 apr2010lab_39 apr2010lab_40 apr2010lab_41 apr2010lab_42 apr2010lab_43 apr2010lab_44 apr2010lab_45 apr2010lab_46 apr2010lab_47 apr2010lab_48 apr2010lab_49 apr2010lab_50 apr2010lab_51 apr2010lab_52 apr2010lab_53 apr2010lab_54 apr2010lab_55 apr2010lab_56 apr2010lab_57 apr2010lab_58 apr2010lab_59 apr2010lab_60 apr2010lab_61 apr2010lab_62 apr2010lab_63 apr2010lab_64 apr2010lab_65 apr2010lab_66 apr2010lab_67 apr2010lab_68 apr2010lab_69 apr2010lab_70 apr2010lab_71 apr2010lab_72 apr2010lab_73 apr2010lab_74 apr2010lab_75 apr2010lab_76 apr2010lab_77 apr2010lab_78 apr2010lab_79 apr2010lab_80 apr2010lab_81 apr2010lab_82 apr2010lab_83 apr2010lab_84 apr2010lab_85 apr2010lab_86 apr2010lab_87 apr2010lab_88 apr2010lab_89 apr2010lab_90 apr2010lab_91 apr2010lab_92 apr2010lab_93 apr2010lab_94 apr2010lab_95 apr2010lab_96 apr2010lab_97 apr2010lab_98 apr2010lab_99 apr2010lab_100 apr2010lab_101 apr2010lab_102 apr2010lab_103 apr2010lab_104 apr2010lab_105 apr2010lab_106 apr2010lab_107 apr2010lab_108 apr2010lab_109 apr2010lab_110 apr2010lab_111 apr2010lab_112 apr2010lab_113 apr2010lab_114 apr2010lab_115 apr2010lab_116 apr2010lab_117 apr2010lab_118 apr2010lab_119 apr2010lab_120 apr2010lab_121 apr2010lab_122 apr2010lab_123 apr2010lab_124 apr2010lab_125 apr2010lab_126 apr2010lab_127 apr2010lab_128 apr2010lab_129 apr2010lab_130 apr2010lab_131 apr2010lab_132 apr2010lab_133 apr2010lab_134 apr2010lab_135 apr2010lab_136 apr2010lab_137 apr2010lab_138 apr2010lab_139 apr2010lab_140 apr2010lab_141 apr2010lab_142 apr2010lab_143 apr2010lab_144 apr2010lab_145 apr2010lab_146 apr2010lab_147 apr2010lab_148 apr2010lab_149 apr2010lab_150 apr2010lab_151 apr2010lab_152 apr2010lab_153 apr2010lab_154 apr2010lab_155 apr2010lab_156 apr2010lab_157 apr2010lab_158 apr2010lab_159 apr2010lab_160 apr2010lab_161 apr2010lab_162 apr2010lab_163 apr2010lab_164 oct2010lab_1 oct2010lab_2 oct2010lab_3 oct2010lab_4 oct2010lab_5 oct2010lab_6 oct2010lab_7 oct2010lab_8 oct2010lab_9 oct2010lab_10 oct2010lab_11 oct2010lab_12 oct2010lab_13 oct2010lab_14 oct2010lab_15 oct2010lab_16 oct2010lab_17 oct2010lab_18 oct2010lab_19 oct2010lab_20 oct2010lab_21 oct2010lab_22 oct2010lab_23 oct2010lab_24 oct2010lab_25 oct2010lab_26 oct2010lab_27 oct2010lab_28 oct2010lab_29 oct2010lab_30 oct2010lab_31 oct2010lab_32 oct2010lab_33 oct2010lab_34 oct2010lab_35 oct2010lab_36 oct2010lab_37 oct2010lab_38 oct2010lab_39 oct2010lab_40 oct2010lab_41 oct2010lab_42 oct2010lab_43 oct2010lab_44 oct2010lab_45 oct2010lab_46 oct2010lab_47 oct2010lab_48 oct2010lab_49 oct2010lab_50 oct2010lab_51 oct2010lab_52 oct2010lab_53 oct2010lab_54 oct2010lab_55 oct2010lab_56 oct2010lab_57 oct2010lab_58 oct2010lab_59 oct2010lab_60 oct2010lab_61 oct2010lab_62 oct2010lab_63 oct2010lab_64 oct2010lab_65 oct2010lab_66 oct2010lab_67 oct2010lab_68 oct2010lab_69 oct2010lab_70 oct2010lab_71 oct2010lab_72 oct2010lab_73 oct2010lab_74 oct2010lab_75 oct2010lab_76 oct2010lab_77 oct2010lab_78 oct2010lab_79 oct2010lab_80 oct2010lab_81 oct2010lab_82 oct2010lab_83 oct2010lab_84 oct2010lab_85 oct2010lab_86 oct2010lab_87 oct2010lab_88 oct2010lab_89 oct2010lab_90 oct2010lab_91 oct2010lab_92 oct2010lab_93 oct2010lab_94 oct2010lab_95 oct2010lab_96 oct2010lab_97 oct2010lab_98 oct2010lab_99 oct2010lab_100 oct2010lab_101 oct2010lab_102 oct2010lab_103 oct2010lab_104 oct2010lab_105 oct2010lab_106 oct2010lab_107 oct2010lab_108 oct2010lab_109 oct2010lab_110 oct2010lab_111 oct2010lab_112 oct2010lab_113 oct2010lab_114 oct2010lab_115 oct2010lab_116 oct2010lab_117 oct2010lab_118 oct2010lab_119 oct2010lab_120 oct2010lab_121 oct2010lab_122 oct2010lab_123 oct2010lab_124 oct2010lab_125 oct2010lab_126 oct2010lab_127 oct2010lab_128 oct2010lab_129 oct2010lab_130 oct2010lab_131 oct2010lab_132 oct2010lab_133 oct2010lab_134 oct2010lab_135 oct2010lab_136 oct2010lab_137 oct2010lab_138 oct2010lab_139 oct2010lab_140 oct2010lab_141 oct2010lab_142 oct2010lab_143 oct2010lab_144 oct2010lab_145 oct2010lab_146 oct2010lab_147 oct2010lab_148 oct2010lab_149 oct2010lab_150 oct2010lab_151 oct2010lab_152 oct2010lab_153 oct2010lab_154 oct2010lab_155 oct2010lab_156 oct2010lab_157 oct2010lab_158 oct2010lab_159 oct2010lab_160 oct2010lab_161 oct2010lab_162 oct2010lab_163 oct2010lab_164


*********************************
** Add FE's
*********************************

* Adding these FE's are the result of a diagnostic test done in FiveYrUJT3

* replace labelfac912 with extra fixed effects
gen labelclean3=labelclean1
foreach x in oct2009lab_79	apr2009lab_86	oct2008lab_91	oct2009lab_94	apr2010lab_94 oct2007lab_74	oct2008lab_143	oct2007lab_89	oct2009lab_91  oct2007lab_154 apr2008lab_137 oct2008lab_143 oct2007lab_122 apr2010lab_112 {
replace labelclean3="`x'" if `x'==1
}
encode labelclean3, gen(labelfac912)


****************************************
**  RSK score - identification test
****************************************


qui reg rskscr   i.quarter i.labelfac912 $ujt $sample
test $ujt

/*              F(528, 11974) =    1.04
            Prob > F =    0.2423

*/

sort numzz
matrix b_labtt=e(b)
matrix V_labtt=vecdiag(e(V))
matrix V_labtt = V_labtt'
matrix list V_labtt
matrix b_labtt=b_labtt'
matrix list b_labtt
svmat b_labtt
svmat V_labtt
replace b_labtt=. in 1/195
replace b_labtt=. in 1344
gen se_labtt=sqrt(V_labtt)
gen tstat_rsktt=b_labtt/se_labtt
la var tstat_rsktt "T-statistics on linear time trend interacted with facility fixed effects - risk" 
gen absTrsktt=abs(tstat_rsktt)
gen prsktt=ttail(10000, absTrsktt)*2
sort prsktt
gen neg=-prsktt
sort neg
gen m=_n-1
sort prsktt
*put actual number of observations here
gen BHrsktt=prsktt*528/(528-m)
sort BHrsktt
 drop b_labtt1 b_labtt1 V_labtt1 se_labtt neg m

* shift distribution to center
sum tstat_rsktt,d
gen tstat_rsk_c=tstat_rsktt-r(mean)
gen abs_trsk=-abs(tstat_rsk_c)
sort abs_trsk

****************************************
**  CH score
****************************************

qui reg chscr  i.quarter i.labelfac912  $ujt $sample
test $ujt

/*
       F(528, 11974) =    1.08
            Prob > F =    0.1125
*/

sort numzz
matrix b_labtt=e(b)
matrix V_labtt=vecdiag(e(V))
matrix V_labtt = V_labtt'
matrix list V_labtt
matrix b_labtt=b_labtt'
matrix list b_labtt
svmat b_labtt
svmat V_labtt
replace b_labtt=. in 1/195
replace b_labtt=. in 1344
gen se_labtt=sqrt(V_labtt)
gen tstat_chtt=b_labtt/se_labtt
la var tstat_chtt "T-statistics on linear time trend interacted with facility fixed effects - risk" 
gen absTchtt=abs(tstat_chtt)
gen pchtt=ttail(10000, absTchtt)*2
sort pchtt
gen neg=-pchtt
sort neg
gen m=_n-1
sort pchtt
gen BHchtt=pchtt*528/(528-m)
sort BHchtt
 drop b_labtt1 b_labtt1 V_labtt1 se_labtt neg m
 
* shift distribution to center
sum tstat_chtt,d
gen tstat_ch_c=tstat_chtt-r(mean)
gen abs_tch=-abs(tstat_ch_c)
sort abs_tch 
 
 
drop $ujt 
drop apr2007 oct2007 apr2008 oct2008 apr2009 oct2009 apr2010 oct2010 lab_1 lab_2 lab_3 lab_4 lab_5 lab_6 lab_7 lab_8 lab_9 lab_10 lab_11 lab_12 lab_13 lab_14 lab_15 lab_16 lab_17 lab_18 lab_19 lab_20 lab_21 lab_22 lab_23 lab_24 lab_25 lab_26 lab_27 lab_28 lab_29 lab_30 lab_31 lab_32 lab_33 lab_34 lab_35 lab_36 lab_37 lab_38 lab_39 lab_40 lab_41 lab_42 lab_43 lab_44 lab_45 lab_46 lab_47 lab_48 lab_49 lab_50 lab_51 lab_52 lab_53 lab_54 lab_55 lab_56 lab_57 lab_58 lab_59 lab_60 lab_61 lab_62 lab_63 lab_64 lab_65 lab_66 lab_67 lab_68 lab_69 lab_70 lab_71 lab_72 lab_73 lab_74 lab_75 lab_76 lab_77 lab_78 lab_79 lab_80 lab_81 lab_82 lab_83 lab_84 lab_85 lab_86 lab_87 lab_88 lab_89 lab_90 lab_91 lab_92 lab_93 lab_94 lab_95 lab_96 lab_97 lab_98 lab_99 lab_100 lab_101 lab_102 lab_103 lab_104 lab_105 lab_106 lab_107 lab_108 lab_109 lab_110 lab_111 lab_112 lab_113 lab_114 lab_115 lab_116 lab_117 lab_118 lab_119 lab_120 lab_121 lab_122 lab_123 lab_124 lab_125 lab_126 lab_127 lab_128 lab_129 lab_130 lab_131 lab_132 lab_133 lab_134 lab_135 lab_136 lab_137 lab_138 lab_139 lab_140 lab_141 lab_142 lab_143 lab_144 lab_145 lab_146 lab_147 lab_148 lab_149 lab_150 lab_151 lab_152 lab_153 lab_154 lab_155 lab_156 lab_157 lab_158 lab_159 lab_160 lab_161 lab_162 lab_163 lab_164
drop   tstat_chtt absTchtt pchtt BHchtt  tstat_rsktt absTrsktt prsktt BHrsktt      
